﻿Imports Tohto.Base.DBUtility
Imports Tohto.Base.Entity
Imports Oracle.DataAccess.Client

Public Class UT0180B01

    ''' <summary>
    ''' 業者区分リスト取得
    ''' </summary>
    ''' <param name="strLoginid">ログインID</param>
    ''' <param name="errInfo">エラー情報</param>
    ''' <returns>業者区分リスト</returns>
    Public Function Fetch_List(ByVal strLoginid As String _
                          , ByRef errInfo As PLSQLErrorInfo) As DataSet

        errInfo.Clear()

        Dim strCmdText As String
        strCmdText = "PG_UT0180.FETCH_LIST"

        Dim parameters(3) As OracleParameter

        'ログインID
        Dim I_VC_LOGINID As New OracleParameter("I_VC_LOGINID", OracleDbType.Varchar2, ParameterDirection.Input)
        I_VC_LOGINID.Value = strLoginid

        Dim O_CU_GYOSHA_KB_ICHIRAN As New OracleParameter("O_CU_GYOSHA_KB_ICHIRAN", OracleDbType.RefCursor, ParameterDirection.Output)
        Dim O_CU_ERR As New OracleParameter("O_CU_ERR", OracleDbType.RefCursor, ParameterDirection.Output)
        Dim O_STATS As New OracleParameter("O_STATS", OracleDbType.Int32, ParameterDirection.ReturnValue)

        parameters(0) = I_VC_LOGINID

        parameters(1) = O_CU_GYOSHA_KB_ICHIRAN
        parameters(2) = O_CU_ERR
        parameters(3) = O_STATS

        Dim ds As DataSet = Nothing
        Dim tableNames(0) As String
        tableNames(0) = "O_CU_GYOSHA_KB_ICHIRAN"

        ds = OracleHelp.FillTable(OracleHelp.ConnectionStringLocalTransaction,
                                           CommandType.StoredProcedure,
                                           strCmdText,
                                           errInfo,
                                           parameters,
                                           tableNames)
        Return ds

    End Function

End Class
